package com.jason.frescotest;

import android.app.Activity;
import android.os.Bundle;
import android.widget.GridView;

import com.jason.frescotest.adapter.GifAdapter;
import com.jason.frescotest.bean.ImageData;
import com.jason.frescotest.utils.ImageURL;

import java.util.ArrayList;
import java.util.List;


/**
 * @Author: Jason
 * @Date: 15/12/25
 * @Time: 14:37
 */

public class GridActivity extends Activity {

    private GridView mGridView;
    private List<ImageData> list = new ArrayList<>();

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.activity_gridimage);

        mGridView = (GridView) findViewById(R.id.gridview);

        for (int i = 0; i < ImageURL.gitUrl.length; i++) {
            list.add(new ImageData(ImageURL.gitUrl[i], 1));
        }

        for (int i = 0; i < ImageURL.imageUrl.length; i++) {
            list.add(new ImageData(ImageURL.imageUrl[i], 0));
        }

        for (int i = 0; i < ImageURL.imageUrl.length; i++) {
            list.add(new ImageData(ImageURL.imageUrl[i], 0));
        }

        for (int i = 0; i < ImageURL.gitUrl.length; i++) {
            list.add(new ImageData(ImageURL.gitUrl[i], 1));
        }

        for (int i = 0; i < ImageURL.gitUrl.length; i++) {
            list.add(new ImageData(ImageURL.gitUrl[i], 1));
        }

        for (int i = 0; i < ImageURL.gitUrl.length; i++) {
            list.add(new ImageData(ImageURL.gitUrl[i], 1));
        }

        for (int i = 0; i < ImageURL.imageUrl.length; i++) {
            list.add(new ImageData(ImageURL.imageUrl[i], 0));
        }

        for (int i = 0; i < ImageURL.imageUrl.length; i++) {
            list.add(new ImageData(ImageURL.imageUrl[i], 0));
        }


        GifAdapter adapter = new GifAdapter(list, this);


        mGridView.setAdapter(adapter);

    }
}
